package com.backend.system.controller;

import com.backend.system.beans.dictionary.DictionaryAddOrUpdateReq;
import com.backend.system.common.ResponseEntity;
import com.backend.system.service.manage.DictionaryManage;
import com.backend.system.util.ResponseUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 * 数据字典表 前端控制器
 * </p>
 *
 * @author back-manage
 * @since 2024-04-12
 */
@Api(tags = "数据字典表 前端控制器")
@RestController
@RequestMapping("/sys/dictionary")
public class DictionaryController {

    /**
     * 新增或修改字典
     */
    @ApiOperation("新增或修改字典")
    @PostMapping("/addOrUpdate")
    public ResponseEntity<Boolean> addOrUpdate(@Valid @RequestBody DictionaryAddOrUpdateReq req) {
        return ResponseUtil.success(DictionaryManage.addOrUpdate(req));
    }
}
